package com.zg.core.ext

import android.content.Context
import android.util.Log
import android.widget.Toast
import com.zg.core.global.AppGlobal

/***
 * @Author:      zxd
 * @CreateDate:  2021/7/6 13:26
 * @Description:
 */

fun Context.toast(message: Any?) {
    Toast.makeText(AppGlobal.sApplication, message.toString(), Toast.LENGTH_SHORT).show()
}

fun Context.longToast(message: Any?) {
    Toast.makeText(AppGlobal.sApplication, message.toString(), Toast.LENGTH_LONG).show()
}

fun Int.dp(): Float {
    return AppGlobal.sApplication.resources.displayMetrics.density * this + 0.5f
}

fun logI(tag: String, msg: String) {
    Log.i(tag, msg)
}

fun logI(msg: String) {
    Log.i("zxd", msg)
}